home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 019a / amac40.zip / RFR002.QM < prev    next >
Text File  |  1991-08-02  |  15KB  |  323 lines

  1. *                               RFR002.QM
  2. *                        Written By Tom Hogshead
  3. *                       [ See RFRMxx.QM For Use ]
  4. *                             August 2, 1991
  5. *  Key       Subfile                       Description
  6. * =====  ===============  ====================================================
  7. * @(3)                    Capitalize First Letter Of All Words In COLUMN Block
  8. * @(4)                    Capitalize First Letter Of All Words In CHARACTER Blk
  9. * @(t)                         (Alternate version of @4 for technique only)
  10. * @(8)                         (Alternate version of @4 for technique only)
  11. * @(5)                    Capitalize First Letter Of All Words In LINE Block
  12. * #(f1_)                  Capitalize Word At Cursor
  13. * #(f2_)                  Capitalize First Letter Of Word At Cursor
  14. * #(f4_)                  Un-Capitalize Word At Cursor
  15. * @(6)                    Make All Letters In Block LOWER Case
  16. * @(7)                    Make All Letters In Block UPPER Case
  17. *
  18. *          {e:\up\RFRM*}--Return To RFRMxx.QM
  19. *
  20. *-- eoi
  21.  
  22. * 
  23. * ------------------------------------------------------
  24. * #(f1_) Capitalize word at cursor
  25. * ------------------------------------------------------
  26. *
  27. #f1 macrobegin markword upper unmarkblock
  28. *
  29. * 7 bytes Mon  08-20-1990  07:17:53
  30.  
  31. * 
  32. * ----------------------------------------
  33. * #(f2_) Capitalize first letter of word
  34. * ----------------------------------------
  35. *
  36. #f2 macrobegin
  37.     markword
  38.     gotoblockbeg
  39.     unmarkblock
  40.     markcolumn
  41.     upper
  42.     unmarkblock
  43. *
  44. * 10 bytes Sun  03-10-1991  16:05:55
  45.  
  46. * 
  47. *------------------------------------------------------------
  48. * @(3)  Capitalize First Letter of All Words In Column Block
  49. *------------------------------------------------------------
  50.  
  51. * Mark column block, then press @3 to capitalize first letter of every
  52. * word in block.  Unmark when finished if OK.  Block MUST be a column
  53. * block, NOT a line or character block, and need not be closed. This
  54. * macro also unconditionally uppercases the first character of the
  55. * block, so be sure the block includes a full first word.
  56.  
  57. @3     Macrobegin
  58.         AltWordSet                      * For all words
  59.         GotoBlockBeg                    * Test if closed
  60.         JTrue BEG:                      *
  61.         MarkColumn                      * Close if block was started
  62.         gotoblockbeg                    * Test if now closed
  63.         Jfalse END:                     * End macro if no block closed
  64.  BEG:
  65.         Onewindow                       * Close all windows
  66.         Horizontalwindow                * Open window
  67.         editfile "NUL" return           * Load NUL
  68.         copyblock                       * Copy block to NUL
  69.         gotoblockend                    * Position to mark                  |
  70.         #250                            * Mark block end with wierd char    |
  71.         gotoblockbeg                    * Return to block begin             |
  72.         Unmarkblock                     *
  73.  LOOP:                                  *
  74.         Upper                           * Capitalize first letter
  75.         Wordright                       * Move to next word
  76.         Jtrue LOOP:                     * Continue until no more words
  77.  END_LOOP:                              *
  78.         find #250 return "G" return     * Put cursor on wierd char          |
  79.         Cursorleft                      * Position cursor on last char
  80.         MarkColumn                      * Mark column block begin
  81.         Begfile                         * Finish mark
  82.         Copy                            * Copy block to scrap
  83.         Quit                            * Quit NUL
  84.         Prevwindow                      * Return to starting file
  85.         Pasteover                       * Paste back where it was
  86.         Onewindow                       * Close windows
  87.  END:
  88.         DefaultWordSet                  * Reset
  89. *
  90. * 53 bytes Fri  02-22-1991  16:08:43
  91. * 50 bytes Mon  07-15-1991  07:56:46 (TH @3, changed c:! to NUL, shortened)
  92. * 61 bytes Mon  07-15-1991  20:40:59 (TH @3, added windows)
  93. * 63 bytes Mon  07-15-1991  21:16:49 (TH @3, added altwordset)
  94. * 53 bytes Mon  07-15-1991  22:52:27 (TH @3, removed #255)
  95. * 52 bytes Wed  07-17-1991  11:10:41 (TH @3, removed extra unmarkblock)
  96. * 51 bytes Fri  07-19-1991  00:43:20 (TH @3, removed markcolumn)
  97. * 40 bytes Fri  07-19-1991  14:26:26 (TH @3, removed window shrink)
  98. * 51 bytes Tue  07-23-1991  16:14:27 (TH @3, use wierd char to mark NUL |)
  99.  
  100.  
  101. * 
  102. *---------------------------------------------------------------
  103. * @(4)  Capitalize First Letter of All Words In Character Block
  104. *---------------------------------------------------------------
  105.  
  106. * Mark character block, then press @4 to capitalize first letter of
  107. * every word in block.  Unmark when finished if OK.  Block MUST be a
  108. * character block, NOT a column or line block, and need not be closed.
  109. * This macro also unconditionally uppercases the first character of the
  110. * block, so be sure the block includes a full first word.
  111.  
  112. @4 macrobegin
  113.         AltWordSet                      * For all words
  114.         GotoBlockBeg                    * Test if closed
  115.         JTrue BEG:                      *
  116.         DropAnchor                      * Close if block was started
  117.         gotoblockbeg                    * Test if now closed
  118.         Jfalse END:                     * End macro if no block closed
  119.  BEG:
  120.         onewindow horizontalwindow      * Make two windows
  121.         editfile "NUL" return           * Load NUL
  122.         moveblock                       * Move block to NUL
  123.         Unmarkblock                     *
  124.  LOOP:                                  *
  125.         Upper                           * Capitalize first letter
  126.         Wordright                       * Move to next word
  127.         Jtrue LOOP:                     * Continue until no more words
  128.  END_LOOP:                              *
  129.         MarkCharacter                   * Mark character block begin
  130.         Begfile                         * Finish mark
  131.         copy                            * Copy block
  132.         Quit                            * Quit NUL
  133.         Prevwindow                      * Return to starting file
  134.         paste                           * Paste block back where it was
  135.         Onewindow                       * Close windows
  136.  END:                                   * We're done...
  137.         DefaultWordSet                  * Reset
  138. *
  139. * 39 bytes Fri  07-19-1991  14:29:37 (TH @4)
  140.  
  141. * 
  142. * ----------------------------------------------------------------------
  143. * @(t) Capitalize First Letter of All Words In Character Block
  144. *      (Alternate version of @4)
  145. * ----------------------------------------------------------------------
  146.  
  147. * This is an alternate version of @4. I use a block location marker
  148. * #173, move the block to the end of file with a block begin marker
  149. * #174, and move it back where it was when done. It is not as fast as
  150. * @4 and is included here for technique only. This same technique can
  151. * be used for column and line blocks (@3 and @5).
  152.  
  153. @t   Macrobegin
  154.         AltWordSet                      * For all words
  155.         GotoBlockBeg                    * Test if closed
  156.         JTrue BEG:                      *
  157.         DropAnchor                      * Close if block was started
  158.         gotoblockbeg                    * Test if now closed
  159.         Jfalse END:                     * End macro if no block closed
  160.  BEG:
  161.         insertline                      * Insert line on top of block
  162.         #173                            * Insert block location marker
  163.         endfile                         * Go to eof
  164.         addline                         * Add line for block begin marker
  165.         begline                         * Go to bol
  166.         #174                            * Insert block begin marker
  167.         addline                         * Add line for block
  168.         begline                         * Go to bol
  169.         moveblock                       * Move block to eof
  170.         Unmarkblock                     * Unmark to start capitalization
  171.  LOOP:                                  *
  172.         Upper                           * Capitalize first letter
  173.         Wordright                       * Move to next word
  174.         Jtrue LOOP:                     * Capitalize until no more words
  175.         MarkCharacter                   * Start block mark
  176.         Find #174 Return "B" Return     * Find block begin marker
  177.         delline                         * Delete it
  178.         MarkCharacter                   * Close block
  179.         Find #173 Return "G" Return     * Find block location marker
  180.         delline                         * Delete it
  181.         moveblock                       * Move block back where it was
  182.  END:                                   * We're done...
  183.         DefaultWordSet                  * Reset
  184. *
  185. * 51 bytes Fri  07-19-1991  12:11:43 (TH @t)
  186.  
  187. * 
  188. * ----------------------------------------------------------------------
  189. * @(8) Convert Character Block to Initial Capitals
  190. *      (Alternate version of @4)
  191. *      (Written by Tom Hogshead and John Goodman)
  192. * ----------------------------------------------------------------------
  193.  
  194. *     Mark character block, then press @8 to capitalize first letter of
  195. *     every word in block.  Unmark when finished if OK.  Block MUST be
  196. *     a character block, NOT a column or line block, and need not be
  197. *     closed. This macro also unconditionally uppercases the first
  198. *     character of the block, so be sure the block includes a full
  199. *     first word.
  200.  
  201. *     This alternate version uses a technique developed by me with the help
  202. *     of John Goodman.  We move the marked block to the end of the current
  203. *     file, process it, then move it back where it was.  This version is
  204. *     not quite as fast as @4 and is included here for technique only.
  205.  
  206. @8   Macrobegin
  207.         AltWordSet                      * For all words
  208.         GotoBlockBeg                    * Test if closed
  209.         JTrue BEG:                      *
  210.         DropAnchor                      * Close if block was started
  211.         gotoblockbeg                    * Test if now closed
  212.         Jfalse END:                     * End macro if no block closed
  213.  BEG:
  214. *       BegFile InsertLine "* @z " InsertDate InsertTime Gotoblockbeg
  215.         insertline                      * Insert line on top of block
  216.         #173                            * Insert block location marker
  217.         endfile                         * Go to eof
  218.         addline                         * Add line for block begin marker
  219.         begline                         * Go to bol
  220.         #173                            * Insert block begin marker     |
  221. *        addline                         * Add line for block           |a
  222. *        begline                         * Go to bol                    |
  223.         moveblock                       * Move block to eof
  224.         Unmarkblock                     * Unmark to start capitalization
  225.  LOOP:                                  *
  226.         Upper                           * Capitalize first letter
  227.         Wordright                       * Move to next word
  228.         Jtrue LOOP:                     * Capitalize until no more words
  229.         MarkCharacter                   * Start block mark
  230.         Find #173 Return "B" Return     * Find block begin marker
  231. *        delline                         * Delete it                    |a
  232.         MarkCharacter                   * Close block
  233.         DelCh                           * Delete marker character       |
  234.         CursorUp                        * Move up one line              |a
  235.         JoinLine                        * Remove added CR/LF at EOF     |
  236.         RepeatFind                      *                                |b
  237. *         Find Return "G" Return          * Find block location marker   |
  238.         delline                         * Delete it
  239.         moveblock                       * Move block back where it was
  240.  END:                                   * We're done...
  241.         DefaultWordSet                  * Reset
  242. *       BegFile EndLine CursorRight InsertTime
  243. *
  244. * 51 Bytes Fri  07-19-1991  12:11:43 (TH @8)
  245. * 49 Bytes Tue  07-23-1991  22:09:23 (JG @8 Changes |A)
  246. * 45 Bytes Wed  07-24-1991  02:44:09 (TH @8, Substituted Repeatfind |B)
  247.  
  248.  
  249. * 
  250. *------------------------------------------------------------
  251. * @(5)  Capitalize First Letter Of All Words In Line Block
  252. *------------------------------------------------------------
  253.  
  254. * Mark Line Block, Then Press @5 To Capitalize First Letter Of Every
  255. * Word In Block.  Unmark When Finished If OK.  Block MUST Be A Line
  256. * Block, NOT A Column Or Character Block, And Need Not Be Closed.
  257.  
  258. @5 Macrobegin
  259.         AltWordSet                      * For All Words
  260.         GotoBlockBeg                    * Test If Closed
  261.         JTrue BEG:                      *
  262.         MarkLine                        * Close If Block Was Started
  263.         Gotoblockbeg                    * Test If Now Closed
  264.         Jfalse END:                     * End Macro If No Block Closed
  265.  BEG:
  266.         Onewindow Horizontalwindow      * Make Two Windows
  267.         Editfile "NUL" Return           * Load NUL
  268.         Moveblock                       * Move Block To NUL
  269.         Unmarkblock                     *
  270.  LOOP:                                  *
  271.         Upper                           * Capitalize First Letter
  272.         Wordright                       * Move To Next Word
  273.         Jtrue LOOP:                     * Continue Until No More Words
  274.  END_LOOP:                              *
  275.         Cursorup                        * Needed For Line Blocks
  276.         Markline                        * Mark Line Block Begin
  277.         Begfile                         * Finish Mark
  278.         Copy                            * Copy Block To Scrap
  279.         Quit                            * Quit NUL
  280.         Prevwindow                      * Return To Starting File
  281.         Paste                           * Put Block Back Where It Was
  282.         Onewindow                       * Close Windows
  283.  END:                                   *
  284.         DefaultWordSet                  * Reset
  285. *
  286. * 40 Bytes Fri  07-19-1991  14:25:09 (TH @5)
  287.  
  288.  
  289. * 
  290. * -----------------------------------------
  291. * @(6) Make All Letters In Block LOWER Case
  292. * -----------------------------------------
  293.  
  294. @6 Macrobegin
  295.         Lower
  296. *
  297. * 5 Bytes Tue  07-16-1991  08:58:48 (TH @6)
  298.  
  299. * 
  300. * -----------------------------------------
  301. * @(7) Make All Letters In Block UPPER Case
  302. * -----------------------------------------
  303.  
  304. @6 Macrobegin
  305.         Upper
  306. *
  307. * 5 Bytes Tue  07-16-1991  08:58:48 (TH @6)
  308.  
  309. * 
  310. * ------------------------------------------------------
  311. * #(f4_) Un-capitalize Word At Cursor
  312. * ------------------------------------------------------
  313. *
  314. #f4 Macrobegin Markword Lower Unmarkblock
  315. *
  316. * 7 Bytes Mon  08-20-1990  07:18:07
  317.  
  318. * Macros #f7 And #f8 Were Written By Richard Blackburn Of SemWare.
  319. * I Picked Them Up From SemWare Message #317 Intelec Conference 24.
  320. * Comments Are Mine And I Changed Key Assignments From Un-shifted
  321. * To Shifted F7 And F8.
  322.  
  323.